package com.fanxj.service.impl;

import com.fanxj.domain.*;
import com.fanxj.mapper.AdminMapper;
import com.fanxj.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("AdminService")
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    @Override
    public List<Relic> findAllRelic() {
        return  adminMapper.findAllRelic();
    }

    @Override
    public List<User> findAllUser(String role) {
        return adminMapper.findAllUser(role);
    }

    @Override
    public  List<User> findUserByName(String userName) {
        return adminMapper.findUserByName(userName);
    }

    @Override
    public List<Relic> findRelicByName(String relicName) {
        return adminMapper.findRelicByName(relicName);
    }

    @Override
    public void deleteUser(User user) {
       adminMapper.deleteUser(user);
    }

    @Override
    public void updateUser(User user) {
        adminMapper.updateUser(user);
    }

    @Override
    public void deleteRelic(Relic relic) {
        adminMapper.deleteRelic(relic);
    }

    @Override
    public void deleteGroupType(GroupType groupType) {
        adminMapper.deleteGroupType(groupType);
    }

    @Override
    public List<GroupType> findGroupByName(String searchName) {
        return adminMapper.findGroupByName(searchName);
    }

    @Override
    public void deleteDecadeType(DecadeType decadeType) {
        adminMapper.deleteDecadeType(decadeType);
    }

    @Override
    public List<DecadeType> findDecadeByName(String searchName) {
        return adminMapper.findDecadeByName(searchName);
    }

    @Override
    public List<LocalType> findLocalByName(String searchName) {
        return adminMapper.findLocalByName(searchName);
    }

    @Override
    public void deleteLocalType(LocalType localType) {
        adminMapper.deleteLocalType(localType);
    }

    @Override
    public void addGroupType(GroupType groupType) {
        adminMapper.addGroupType(groupType);
    }

    @Override
    public GroupType findGroupTypeByCode(GroupType groupType) {
        return adminMapper.findGroupTypeByCode(groupType);
    }

    @Override
    public void addDecadeType(DecadeType decadeType) {
        adminMapper.addDecadeType(decadeType);
    }

    @Override
    public DecadeType findDecadeTypeByCode(DecadeType decadeType) {
        return adminMapper.findDecadeTypeByCode(decadeType);
    }

    @Override
    public void addLocalType(LocalType localType) {
        adminMapper.addLocalType(localType);
    }

    @Override
    public LocalType findLocalTypeByCode(LocalType localType) {
        return adminMapper.findLocalTypeByCode(localType);
    }

    @Override
    public List<AdminCollection> findAllCollection() {
        return adminMapper.findAllCollection();
    }
    @Override
    public void deleteCollection(CollectionRelic collectionRelic) {
        adminMapper.deleteCollection(collectionRelic);
    }

    @Override
    public List<AdminCollection> findCollectionByName(String uName) {
        return adminMapper.findCollectionByName(uName);
    }

    @Override
    public List<TypeCount> findGroupTypeCount() {
        return adminMapper.findGroupTypeCount();
    }

    @Override
    public List<TypeCount> findCollectionCount() {
        return adminMapper.findCollectionCount();
    }

    @Override
    public void addRelic(Relic relic) {
         adminMapper.addRelic(relic);
    }


}
